//
//  Service+market.m
//  umibus
//
//  Created by 冷山 on 16/6/24.
//  Copyright © 2016年 lexingsoft. All rights reserved.
//

#import "Service+market.h"

@implementation ServiceManager(market)


///获取市场-我的摊位
+ (void)getMyBoothWithPage:(NSInteger)pageIndex type:(NSString*)type success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure
{
    if ([NSString checkNullString:type])
    {
        type = @"";
    }
    NSString * path = [NSString stringWithFormat:@"/couponmarket/page/publish/me"];
    const int countPer=20;
    NSDictionary *parameterDict=@{@"start":@(pageIndex*countPer),
                                  @"length":@(countPer),
                                  @"suitableType":@""};
    [NetworkClient getRequest:path parameters:parameterDict NeedPrompt:YES success:^(id dataObject) {
        success(dataObject);
    } failure:^(id dataObject) {
        failure(dataObject);
    }];
}

///获取市场-自由市场
+ (void)getFreeMarketWithPage:(NSInteger)pageIndex type:(NSString*)type success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure
{
    if ([NSString checkNullString:type])
    {
        type = @"";
    }
    NSString * path = [NSString stringWithFormat:@"/couponmarket/page/publish"];
    const int countPer=20;
    NSDictionary *parameterDict=@{@"start":@(pageIndex*countPer),
                                  @"length":@(countPer),
                                  @"suitableType":type};
    [NetworkClient getRequest:path parameters:parameterDict NeedPrompt:YES success:^(id dataObject) {
        success(dataObject);
    } failure:^(id dataObject) {
        failure(dataObject);
    }];
}


@end
